#include "ai.h"
#include <iostream>
#include <random>

AIPlayer::AIPlayer(const std::string& name, Piece piece) : Player(name, piece) {}

void AIPlayer::makeMove(Board& board) {
    std::cout << name << "正在思考...\n";
    
    // 简单的随机AI
    int size = board.getSize();
    std::random_device rd;
    std::mt19937 gen(rd());
    std::uniform_int_distribution<> dis(0, size - 1);
    
    int x, y;
    do {
        x = dis(gen);
        y = dis(gen);
    } while (!board.isValidMove(x, y));
    
    board.placePiece(x, y, piece);
    std::cout << name << "落子于: " << x << " " << y << "\n";
}

int AIPlayer::evaluatePosition(const Board& board, int x, int y) const {
    // 简单的评估函数（可扩展）
    return 0;
}